﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SchoolGrade.ascx.cs" Inherits="Custom_SchoolGrade" %>
<script language="javascript">
//当前选中年级
var GetCurrentGrade = 0;
function gradeChange()
{
    GetCurrentGrade=event.srcElement.options[event.srcElement.selectedIndex].value;
}
</script>
年级：<select id="grade" onchange="gradeChange()"></select>

<script language="javascript">
 <%
        int index =0;
        Response.Write("var gradessel = document.getElementById('grade');");
        foreach(ShowGrade y in showGrades)
        {
            Response.Write("var oOption = document.createElement('OPTION');");
            Response.Write("oOption.text = '"+y.name+"';");
            Response.Write("oOption.value = "+y.index+";");
            if(index==0)
            {
                Response.Write("oOption.selected = true;GetCurrentGrade="+y.index+";");
            }
            else
            {
                Response.Write("oOption.selected = false;");
            }
            Response.Write("gradessel.add(oOption);");
            index++;
        }
        

 %>
 </script>